package utilities.utilities_components;

import org.zkoss.zul.Combobox;
import org.zkoss.zul.Hbox;
import org.zkoss.zul.Label;
import org.zkoss.zul.Window;

import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;

import utilities.Updatable;

public class RoomTypeController extends Window{
	private Label type;
	private Combobox typebox;
	private Hbox hbox;
	private Updatable updateItem;
	private int currentSelected;
	
	private static final String[] typeItem = { "全部房间", "仅计天房", "仅钟点房" };
	private static final int ALL = 0;
	private static final int BYDAY = 1;
	private static final int BYHOUR = 2;
	
	public RoomTypeController(){		
		hbox = new Hbox();
		
		type = new Label( "房间类型" );
		
		this.prepareTypebox();
		
		hbox.appendChild( type );
		hbox.appendChild( typebox );
		
		this.appendChild( hbox );
	}
	
	public int getSelectedItem(){
		return typebox.getSelectedIndex();
	}
	
	private void prepareTypebox(){
		typebox = new Combobox();
		for( int count = 0; count < typeItem.length; count++ ){
			typebox.appendItem( typeItem[ count ] );
		}
		
		typebox.setSelectedIndex( 0 );
	}
}
